//
//  ZJSetPasswordView.m
//  ZiJinLian
//
//  Created by lzy on 2017/3/10.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "ZJSetPasswordView.h"

@implementation ZJSetPasswordView

-(id)initWithFrame:(CGRect)frame
{
    self=[super initWithFrame:frame];
    if (self) {
        self.backgroundColor=RGB(246, 246, 246);
        [self creatUI];
        
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    [self layOut];
}
-(void)creatUI
{
    self.firstTF=[MYUI createTextFieldFrame:CGRectMake(-2, 30, MainW+5, 98/2) backgroundColor:[UIColor whiteColor] placeholder:MyString(@"请设置您的密码") clearsOnBeginEditing:NO];
    self.firstTF.secureTextEntry=YES;
    [self addSubview:self.firstTF];
    self.secondTF=[MYUI createTextFieldFrame:CGRectMake(0,0, 0, 0) backgroundColor:[UIColor whiteColor] placeholder:MyString(@"请确认您的密码") clearsOnBeginEditing:NO];
     self.secondTF.secureTextEntry=YES;
    [self addSubview:self.secondTF];
    //下一步
    _sureBtn=[MYUI creatButtonFrame:CGRectMake(0,0,0,0) backgroundColor:button_gray_Color setTitle:MyString(@"确定") setTitleColor:[UIColor whiteColor]];
    _sureBtn.layer.cornerRadius=5;
    _sureBtn.layer.masksToBounds=YES;
    _sureBtn.titleLabel.font=FontAndStyle15;
    [self addSubview:self.sureBtn];
    _lab=[MYUI createLableFrame:CGRectMake(0, 0, 0, 0) backgroundColor:[UIColor clearColor] text:MyString(@"密码备注") textColor:PlaceHolder_TxT_Color font:FontAndStyle12 numberOfLines:2 adjustsFontSizeToFitWidth:YES insert:UIEdgeInsetsMake(0,10,0,10)];
    [self addSubview:self.lab];
}
-(void)layOut{
    [self.secondTF makeConstraints:^(MASConstraintMaker *make) {
        //make.left.and.right.equalTo(self.view).offset(0);
        make.centerX.equalTo(self.firstTF);
        make.width.equalTo(self.firstTF);
        make.top.equalTo(self.firstTF.bottom).offset(2);
        make.height.equalTo(self.firstTF);
    }];
    
    [_lab makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.left.equalTo(self.left).offset(0);
        make.right.equalTo(self.right).offset(0);
        make.top.equalTo(self.secondTF.bottom).offset(20);
        make.height.equalTo(55);
    }];
    
    [self.sureBtn makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.left.equalTo(self.left).offset(10);
        make.right.equalTo(self.right).offset(-10);
        make.height.equalTo(98/2);
        make.top.equalTo(_lab.bottom).offset(30);
    }];
}

@end
